﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.ComponentModel;


namespace wage.Controls
{
    public class gridWorkShift : common.controls.baseDataGridView 
    {
        public enum ColumnNames
        {
            code,name
        };

        public gridWorkShift()
        {
        }

        public override void LockEdit(bool lockStat)
        {
            base.LockEdit(true); 
        }
        public override void Init()
        {
            base.Init();
            data.wageDS.wgWorkShiftDataTable dummyTbl = new data.wageDS.wgWorkShiftDataTable();

            // =============================
            // detailGrid
            // =============================

            // code
            common.controls.DataGridViewTextBoxColumnExt code = new common.controls.DataGridViewTextBoxColumnExt();
            code.Uppercase = true;
            code.DataPropertyName = dummyTbl.codeColumn.ColumnName;
            code.HeaderText = "Mã số";
            code.Name = ColumnNames.code.ToString();
            code.Width = 130;

            // name
            common.controls.DataGridViewTextBoxColumnExt name = new common.controls.DataGridViewTextBoxColumnExt();
            name.DataPropertyName = dummyTbl.nameColumn.ColumnName;
            name.HeaderText = "Diễn giải";
            name.Name = ColumnNames.name.ToString();
            name.Width = 130;

            this.Columns.Clear();
            this.Columns.AddRange(new DataGridViewColumn[] { code, name});

            this.myAutoFitColumn = ColumnNames.name.ToString();
            this.AutoFit();
        }

    }
}
